package com.xyzwps.harbor.repo;

import com.xyzwps.harbor.model.UserSession;
import org.springframework.data.r2dbc.repository.Query;
import org.springframework.data.repository.reactive.ReactiveCrudRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Mono;

@Repository
public interface UserSessionRepository extends ReactiveCrudRepository<UserSession, Long> {

    @Query("select seq, user_id, sid, create_time, expire_time from user_session where sid = :sid" )
    Mono<UserSession> findBySid(String sid);
}